package com.example.demo.controller;

import com.example.demo.entity.Edition;
import com.example.demo.entity.response.Response;
import com.example.demo.service.UpgradeService;
import com.example.demo.utils.JsonUtil;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 11237
 */

//@Api(tags ="升级接口")
@RestController
@RequestMapping("/Upgrade")
public class UpgradeController {

    @Resource
    private UpgradeService upgradeService;

    @RequestMapping("paid")
    public Response getNew(@RequestParam String data){
        Edition edition = JsonUtil.getInstance().jsonToBean(data,Edition.class);
        return upgradeService.upgrade(edition);
    }


}
